<? global $lg, $FullUrl; ?>

<div class="form-main">
  <div class="form-header">&nbsp;</div>
  <div class="form-content">
    <div style="padding:0 25px; display:block; overflow:hidden;">
      <div class="title-form"><span>Đăng nhập</span></div>
      <form action="<?=$FullUrl?>/index.php?do=player&act=loginsm" method="post" name="login">
        <label>Tên tài khoản</label>
        <input type="text" name="username" id="username" value="" helper="formText" placeholder="Tài Khoản" maxlength="24"/>
        <br/>
        <label>Mật khẩu</label>
        <input type="password" name="password" id="password" value="" helper="formPassword" placeholder="Mật Khẩu"/>
        <br/>
        <?
        	$_SESSION['captcha'] = mt_rand(10000, 99999);
        ?>
        <div style="display:inline-block; width:350px; float:left;margin-left:130px;"> <img src="lib/Captcha/PHP-CAPTCHA/php_captcha.php"></div>
        <label>Kiểm tra:</label>
        <input type="text" name="number_captcha" id="code" value="" onfocus="if(this.value=='Mã kiểm tra') this.value=''" onblur="if(this.value=='') this.value='Mã kiểm tra'" value="Mã kiểm tra"/>
        <tr>
          <?=isset($notice)?$notice:'';$notice = ''; ?>
        </tr>
        <br/>
        <div style="display:inline-block;float:left;margin-left:40px;"> 
          <input value="Đăng nhập" name="login" type="submit" class="btn-form sbm" onClick="return validateFormLogin()">
          <a href="<?=$FullUrl?>/index.php?do=player&act=register">
          <div class="btn-form"  style="padding-top:7px;margin-left:5px;margin-top:7px;">Đăng ký</div>
          </a>
        </div>
      </form>
    </div>
  </div>
  <div class="form-bottom">&nbsp;</div>
</div>
<script type="text/javascript">
function validateFormLogin()
{
 
	var x=document.forms["login"]["username"].value;
	var y=document.forms["login"]["password"].value;
	var z=document.forms["login"]["code"].value;

	if (x==null || x=='' || y==null || y=='' || z ==null || z =='')
	{  
		alert("Bạn cần điền đầy đủ thông tin");  
		
		return false;
	}
	
	return true;
	
}
</script>